﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using KingRoad.EPM.SafetyManagementBLL.Domain;
using KingRoad.EPM.SafetyManagementEntity.Model;
using Unis.Framework.Core.Utility;
using KingRoad.EPM.SafetyManagementDAL.ScmPotentialAdviceService;


namespace KingRoad.EPM.SafetyManagementBLL.UIRules
{
    /// <summary> 
    /// 客户端业务处理类。 
    /// 文件生成时间 2017/3/13 14:59:55
    /// </summary> 
    public class ScmPotentialadviceUIRule
    {
        private readonly IScmPotentialadviceService _scmPotentialadviceService;
        
        
        public ScmPotentialadviceUIRule(){}
        
        /// <summary> 
        /// construct function... 
        /// </summary> 
        public ScmPotentialadviceUIRule(IScmPotentialadviceService  scmPotentialadviceService)
        {
           _scmPotentialadviceService=scmPotentialadviceService;
        }

        /// <summary>
        /// 获取 台账信息
        /// </summary>
        /// <returns></returns>
        public List<ScmPotentialadviceInfo> GetAllPotentialadvice()
        {
            var list = _scmPotentialadviceService.GetEntityList();
            return list;
        }
        
        /// <summary>
        /// 获取 台账信息 根据ID获取
        /// </summary>
        /// <returns></returns>
        public ScmPotentialadviceInfo GetPotentialadviceByID(Guid id)
        {
            var list = _scmPotentialadviceService.GetEntityById(id);
            return list;
        }

        /// <summary>
        /// 添加 台账信息
        /// </summary>
        /// <returns></returns>
        public int AddPotentialadvice(ScmPotentialadviceInfo AddEntity)
        {
            return _scmPotentialadviceService.InsertEntity(AddEntity);
        }

        /// <summary>
        /// 删除 台账信息(批量删除)
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int DeletePotentialadviceMulti(string id)
        {
            return _scmPotentialadviceService.DeleteEntityByMultiStringID(id);
        }

        /// <summary>
        /// 更新 台账信息
        /// </summary>
        /// <returns></returns>
        public int UpdatePotentialadvice(ScmPotentialadviceInfo UpdateEntity)
        {
            return _scmPotentialadviceService.UpdateEntity(UpdateEntity);
        }

        /// <summary>
        /// 根据条件查询信息
        /// </summary>
        /// <param name="numCurrentPage">当前页</param>
        /// <param name="numPerPage">每页数据大小</param>
        /// <param name="orderByField">排序字段名称</param>
        /// <param name="totalRecord">总数据量</param>
        /// <param name="sqlCondition">sql查询条件</param>
        /// <returns></returns>
        public List<ScmPotentialadviceInfo> GetPotentialadviceForSearch(int numCurrentPage, int numPerPage,
                                                                        string orderByField, out int totalRecord, string sqlCondition)
        {
            //var list = _scmPotentialadviceService.GetEntityListByContion(numCurrentPage, numPerPage, orderByField, out totalRecord, sqlCondition);
            var list = _scmPotentialadviceService.GetEntityListByContionRe(numCurrentPage, numPerPage, orderByField, out totalRecord, sqlCondition);            
            return list;
        }
        ///// <summary>
        ///// 根据条件查询 台账信息
        ///// </summary>
        ///// <param name="numCurrentPage">当前页</param>
        ///// <param name="numPerPage">每页数据大小</param>
        ///// <param name="orderByField">排序字段名称</param>
        ///// <param name="totalRecord">总数据量</param>
        ///// <param name="sqlCondition">sql查询条件</param>
        ///// <returns></returns>
        //public List<ScmPotentialadviceInfo> GetAllPotentialadviceForPage(int numCurrentPage, int numPerPage, string orderByField, out int totalRecord, string sqlCondition)
        //{
        //    var list = _scmPotentialadviceService.GetEntityListByContionRe(numCurrentPage, numPerPage, orderByField, out totalRecord, sqlCondition);
        //    return list;
        //}
    }
}

